/**
 * Description:
 * Class Name:FinalReplaceTest
 * Date:2022/1/29 11:33
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第6章_面向对象_下._6_4_final修饰符;

public class FinalReplaceTest {
    public static void main(String[] args) {
        // 下面定义了4个final“宏变量”
        final var a = 5 + 2;
        final var b = 1.2/3;
        final var str = "疯狂" + "Java";
        final var book = "疯狂Java讲义：" + 99.0;
        // 下面的book2变量的值调用了方法，无法在编译时就确定下来
        final var book2 = "疯狂Java讲义" + String.valueOf("99.0");
        System.out.println(book == "疯狂Java讲义：99.0");                // true
        System.out.println(book2 == "疯狂Java讲义：99.0");               // false
    }
}
